<template>
  <div class="section-body">
    <div class="coupon-box" v-show="styleType == 1">
      <div
        class="coupon-content"
        v-for="(item, index) in 3"
        :key="index"
        :style="{ backgroundImage: `url(${propsData.params.couponPic})` }"
      >
        <div class="info-box">
          <div
            class="price"
            :style="{ color: propsData.params.colorConfig.priceColor }"
          >
            <span>¥</span>
            <span>&nbsp;99</span>
          </div>
          <div
            class="info"
            :style="{ color: propsData.params.colorConfig.infoColor }"
          >
            2021.8.9到期
          </div>
        </div>

        <div class="receive">
          <span :style="{ color: propsData.params.colorConfig.btnColor }"
            >立即领取</span
          >
        </div>
      </div>
    </div>

    <div class="style-two" v-if="styleType == 2">
      <div class="node-item" v-for="(item, index) in 3" :key="index">
        <div
          class="node-bg"
          :style="{ background: propsData.params.colorConfig.bgColor }"
        >
          <div class="top-circle"></div>
          <div class="down-circle"></div>
          <div
            class="dashed-line"
            :style="{ borderColor: propsData.params.colorConfig.breakLine }"
          ></div>
        </div>
        <div class="node-content">
          <div class="info-box">
            <div
              class="price"
              :style="{ color: propsData.params.colorConfig.priceColor }"
            >
              <span>¥</span>
              <span>&nbsp;99</span>
            </div>
            <div
              class="info"
              :style="{ color: propsData.params.colorConfig.infoColor }"
            >
              2021.8.9到期
            </div>
          </div>
          <div class="receive">
            <span :style="{ color: propsData.params.colorConfig.btnColor }"
              >立即领取</span
            >
          </div>
        </div>
      </div>
    </div>

    <div class="style-three" v-if="styleType == 3">
      <div class="node-item" v-for="(item, index) in 3" :key="index">
        <div
          class="node-bg"
          :style="{ background: propsData.params.colorConfig.bgColor }"
        ></div>
        <div class="node-content">
          <div class="top-circle"></div>
          <div
            class="down-circle"
            :style="{ background: propsData.params.colorConfig.bgColor }"
          ></div>
          <div class="info-box">
            <div
              class="price"
              :style="{ color: propsData.params.colorConfig.priceColor }"
            >
              <span>¥</span>
              <span>&nbsp;99</span>
            </div>
            <div
              class="info"
              :style="{ color: propsData.params.colorConfig.infoColor }"
            >
              2021.8.9到期
            </div>
          </div>
          <div class="solid-line"></div>
          <div class="receive">
            <span :style="{ color: propsData.params.colorConfig.btnColor }"
              >立即领取</span
            >
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {
    styleType() {
      return this.propsData.params.styleType || "1";
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.section-body {
  .coupon-box {
    width: 100%;
    height: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    .coupon-content {
      width: 158px;
      height: 92px;
      margin-right: 8px;
      flex-shrink: 0;
      padding: 0 19px 0 8px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .info-box {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .price {
          font-size: 24px;
          font-weight: bold;
          color: #ec2827;
          display: flex;
          align-items: baseline;
          line-height: 1;
          span:first-child {
            font-size: 12px;
          }
        }
        .info {
          font-size: 11px;
          line-height: 20px;
          margin-top: 8px;
          color: #ffffff;
        }
      }

      .receive {
        width: 40px;
        height: 40px;
        background: linear-gradient(180deg, #ffeecf 0%, #fed59b 100%);
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        span {
          width: 24px;
          font-size: 12px;
          line-height: 14px;
          color: #ec2827;
        }
      }
    }
    .coupon-content :last-child {
      margin-right: 0;
    }
  }
  .style-two {
    width: 351px;
    height: 92px;
    display: flex;
    align-items: center;
    overflow-x: scroll;
    overflow-y: hidden;
    .node-item {
      width: 158px;
      height: 92px;
      margin-right: 12px;
      position: relative;
      .node-bg {
        width: 158px;
        height: 92px;
        background: linear-gradient(90deg, #ffb85c 0%, #ff7734 100%);
        position: relative;
        border-radius: 10px;
        .top-circle,
        .down-circle {
          width: 12px;
          height: 12px;
          background: #ffffff;
          border-radius: 50%;
          position: absolute;
          left: 97px;
          top: -6px;
          display: none;
        }
        .down-circle {
          top: inherit;
          bottom: -6px;
        }
        .dashed-line {
          height: 75px;
          border: 1px dashed #e87531;
          position: absolute;
          left: 114px;
          top: 9px;
        }
      }
      .node-content {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px 0 18px;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 11;
        .info-box {
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          .price {
            font-size: 24px;
            font-weight: bold;
            color: #ffffff;
            display: flex;
            align-items: baseline;
            line-height: 1;
            margin-bottom: 10px;
            span:first-child {
              font-size: 12px;
            }
          }
          .info {
            font-size: 12px;
            line-height: 20px;
            color: #ffffff;
            margin-bottom: 0;
          }
        }
        .receive {
          width: 16px;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          span {
            width: 16px;
            font-size: 14px;
            color: #ffffff;
            line-height: 14px;
          }
        }
      }
    }
  }

  .style-three {
    width: 100%;
    height: 92px;
    display: flex;
    align-items: center;
    overflow-x: scroll;
    overflow-y: hidden;
    .node-item {
      width: 158px;
      height: 92px;
      margin-right: 12px;
      position: relative;
      padding-top: 7px;
      .node-bg {
        width: 151px;
        height: 85px;
        background: #ffa473;
        margin-left: 7px;
      }
      .node-content {
        width: 151px;
        height: 85px;
        background: #ffffff;
        border: 1px solid #666666;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 11;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .info-box {
          width: 97px;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          .price {
            font-size: 24px;
            font-weight: bold;
            color: #ffcb3f;
            display: flex;
            align-items: baseline;
            line-height: 1;
            margin-bottom: 5px;
            span:first-child {
              font-size: 12px;
            }
          }
          .info {
            font-size: 12px;
            line-height: 20px;
            color: #404040;
            margin-top: 8px;
          }
        }
        .solid-line {
          width: 1px;
          height: 47px;
          background-color: #cccccc;
          position: absolute;
          left: 97px;
          top: 20px;
        }
        .receive {
          flex: 1;
          display: flex;
          align-items: center;
          padding-left: 20px;
          span {
            width: 16px;
            font-size: 14px;
            font-family: PingFang SC;
            color: #404040;
            flex-shrink: 0;
            line-height: 14px;
          }
        }
        .top-circle {
          width: 12px;
          height: 12px;
          background: #ffffff;
          border-bottom: 1px solid #666666;
          border-radius: 50%;
          position: absolute;
          left: 90px;
          top: -6px;
        }
        .down-circle {
          width: 12px;
          height: 12px;
          background: #ffa473;
          border-radius: 50%;
          position: absolute;
          left: 90px;
          bottom: -6px;
          border-top: 1px solid #ffa473;
        }
      }
    }
  }

  ::-webkit-scrollbar {
    height: 0 !important;
    width: 0px !important;
  }
}
</style>
